
<h4>系统日志列表</h4>
<form nz-form class="">
  <div nz-row [nzGutter]="40" class="mgb20">
    <div nz-col [nzSpan]="6">
      <input nz-input placeholder="请求ip" [(ngModel)]="value.request_ip.val" name="value.request_ip.val"/>
    </div>
    <div nz-col [nzSpan]="6">
      <input nz-input placeholder="请求类型" [(ngModel)]="value.request_method.val" name="value.request_method.val"/>
    </div>
    <div nz-col [nzSpan]="6">
      <input nz-input placeholder="客户端" [(ngModel)]="value.client_version.val" name="value.client_version.val"/>
    </div>
    <div nz-col [nzSpan]="6">
      <input nz-input placeholder="状态(如:400,500)" [(ngModel)]="value.status.val" name="value.status.val"/>
    </div>
  </div>
  <div nz-row [nzGutter]="40" class="mgb20">
    <div nz-col [nzSpan]="6">
      <input nz-input placeholder="处理时间(如:100,200)" [(ngModel)]="value.time.val" name="value.time.val"/>
    </div>
    <div nz-col [nzSpan]="6">
      <!-- <app-datetime-range name="created_at" xSize="large" xFormat="YYYY-MM-DD HH:mm:ss" [(ngModel)]="value.created_at.val"></app-datetime-range> -->
      <nz-range-picker name="created_at" nzFormat="YYYY-MM-DD" [(ngModel)]="value.created_at.val"></nz-range-picker>
    </div>
    <div nz-col [nzSpan]="6">
      <input nz-input placeholder="客户端" [(ngModel)]="value.client_version.val" name="value.client_version.val"/>
    </div>
    <div nz-col [nzSpan]="6">
      <nz-select name="source" nzPlaceHolder="请求来源" [(ngModel)]="value.source.val">
        <nz-option nzLabel="请选择请求来源" [nzValue]="''"> </nz-option>
        <nz-option nzLabel="v2" [nzValue]="'v2'"> </nz-option>
        <nz-option nzLabel="cms" [nzValue]="'cms'"> </nz-option>
      </nz-select>
    </div>
  </div>
  
  <div nz-row>
    <div nz-col [nzSpan]="24" class="right-btns">
      <button nz-button (click)="sync()" [nzLoading]="_loading">同步地址</button>
      <button nz-button (click)="clear()" [nzLoading]="_loading">清空</button>
      <button nz-button nzType="primary" (click)="query(1)" [nzLoading]="_loading">查询</button>
    </div>
  </div>
</form>



<nz-table #nzTable
  [nzData]="dataSet"
  [nzFrontPagination]="false"
  [nzShowSizeChanger]="false"
  [nzLoading]="_loading"
  [nzTotal]="total"
  [(nzPageIndex)]="current_page"
  (nzPageIndexChange)="query(undefined)"
  [(nzPageSize)]="per_page"
  (nzPageSizeChange)="query(1)">
  <thead nz-thead>
    <tr>
      <th nz-th><span>ip</span></th>
      <th nz-th style="width:120px;"><span>url</span></th>
      <th nz-th style="width:120px;"><span>参数</span></th>
      <th nz-th><span>请求类型</span></th>
      <th nz-th><span>客户端版本</span></th>
      <th nz-th><span>请求状态</span></th>
      <th nz-th><span>处理时间</span></th>
      <th nz-th><span>地理位置</span></th>
      <th nz-th><span>创建时间</span></th>
      <th nz-th><span>创建者</span></th>
      <th nz-th><span>来源</span></th>
      <th nz-th><span>操作</span></th>
    </tr>
  </thead>
  <tbody nz-tbody>
    <tr nz-tbody-tr *ngFor="let data of nzTable.data">
      <td nz-td>{{data.request_ip}}</td>
      <td nz-td>
        <div style="overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;" title="{{data.request_url}}">{{data.request_url}}</div>
      </td>
      <td nz-td>
        <div style="overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;" title="{{data.request_params}}">{{data.request_params}}</div>
      </td>
      <td nz-td>{{data.request_method}}</td>
      <td nz-td>{{data.client_version}}</td>
      <td nz-td><nz-badge [nzStatus]="getStatus(data.status)" [nzText]="data.status"></nz-badge></td>
      <td nz-td>{{data.time}}ms</td>
      <td nz-td>{{data.continent_name_zh||'-'}}/{{data.country_name_zh||'-'}}/{{data.subdivisions_name_zh||'-'}}/{{data.city_name_zh||'-'}}</td>
      <td nz-td>{{data.created_at}}</td>
      <td nz-td>{{data.creator ? data.creator.nick_name : '未知者'}}</td>
      <td nz-td>{{data.source}}</td>
      <td nz-td>
        <a href="#" [routerLink]="['/systemlog/detail', data.id]">详情</a>
        <a href="javascript:;" (click)="delSystemLog(data.id)">删除</a>
      </td>
    </tr>
  </tbody>
</nz-table>
